/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package biermanager.componentes;

import java.awt.Color;
import java.awt.LinearGradientPaint;
import java.awt.geom.Point2D;
import java.beans.*;
import java.io.Serializable;
import org.jdesktop.swingx.JXPanel;
import org.jdesktop.swingx.painter.CompoundPainter;
import org.jdesktop.swingx.painter.MattePainter;
import org.jdesktop.swingx.painter.Painter;
import org.jdesktop.swingx.painter.PinstripePainter;

/**
 *
 * @author tiagoloureiro
 */
public class PainelMenu extends JXPanel implements Serializable {

    public Painter painel2Cores() {
        PinstripePainter pinstripe = new PinstripePainter(
        new Color(155,155,155,10),  0.);
        pinstripe.setSpacing(2);
        pinstripe.setStripeWidth(2);
        PinstripePainter pinstripe2 = new PinstripePainter(
        new Color(155,155,155,10),  90.);
        pinstripe2.setSpacing(2);
        pinstripe2.setStripeWidth(2);

        Color cor1 = new Color(118, 118, 118);
        Color cor2 = new Color(50, 50, 50);
        Color cor3 = new Color(0, 0, 0);
        Point2D start = new Point2D.Float(0, 0);
        Point2D end = new Point2D.Float(0, (float) ((this.getPreferredSize().getHeight() - 1) / 2));
        float[] dist = {0.0f, 0.98f, 0.99f, 1.0f};
        Color[] colors = {cor1, cor2, cor3, cor3};
        LinearGradientPaint p = new LinearGradientPaint(start, end, dist, colors);
        MattePainter mp = new MattePainter(p);
        MattePainter mp2 = new MattePainter(new Color(0, 0, 0));
        CompoundPainter cp = new CompoundPainter(mp,pinstripe, pinstripe2);
        cp.setAntialiasing(true);
        return (cp);
    }
    public static final String PROP_SAMPLE_PROPERTY = "sampleProperty";

    private String sampleProperty;

    private PropertyChangeSupport propertySupport;

    public PainelMenu() {
        propertySupport = new PropertyChangeSupport(this);
    }

    public String getSampleProperty() {
        return sampleProperty;
    }

    public void setSampleProperty(String value) {
        String oldValue = sampleProperty;
        sampleProperty = value;
        propertySupport.firePropertyChange(PROP_SAMPLE_PROPERTY, oldValue, sampleProperty);
    }


    public void addPropertyChangeListener(PropertyChangeListener listener) {
        propertySupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        propertySupport.removePropertyChangeListener(listener);
    }

}
